<template>
    <!-- 我的库存/查看明细 -->
      <el-dialog title="货物明细" :visible.sync="openStockDetail" width="800px" append-to-body :destroy-on-close="true" :before-close="beforeClose">
          <div class="mt20 mb20 ml10">
            <el-descriptions>
                <el-descriptions-item label="品名">{{ data.spzs }}</el-descriptions-item>
                <el-descriptions-item label="纱支">{{ data.wpggA || '-' }}</el-descriptions-item>
                <el-descriptions-item label="品牌">{{ data.spcd }}</el-descriptions-item>
            </el-descriptions>
            <el-descriptions>
                <el-descriptions-item label="单重">{{ data.spjsl }}KG</el-descriptions-item>
                <!-- <el-descriptions-item label="支重">{{  }}</el-descriptions-item> -->
                <el-descriptions-item label="件数">{{ data.spjs }}件</el-descriptions-item>
            </el-descriptions>
            <el-descriptions>
                <el-descriptions-item label="重量">{{ data.spsl }}吨</el-descriptions-item>
                <el-descriptions-item label="批次">{{ data.spbh }}</el-descriptions-item>
                <el-descriptions-item label="柜号">{{ data.spgh }}</el-descriptions-item>
            </el-descriptions>
            <el-descriptions>
                <el-descriptions-item label="用途">{{ data.wpggD || '-'}}</el-descriptions-item>
                <el-descriptions-item label="产地">{{ data.wpggE || '-'}}</el-descriptions-item>
                <el-descriptions-item label="工艺">{{ data.wpggB || '-' }}</el-descriptions-item>
            </el-descriptions>
            <el-descriptions>
                <el-descriptions-item label="工序">{{ data.wpggC || '-' }}</el-descriptions-item>
                <el-descriptions-item label="漂染性">{{ data.wpggF || '-' }}</el-descriptions-item>
                <el-descriptions-item label="颜色">{{ data.wpggH || '-' }}</el-descriptions-item>
            </el-descriptions>
            <el-descriptions>
                <el-descriptions-item label="仓库">{{ data.spckmc }}</el-descriptions-item>
                <el-descriptions-item label="库位">{{ data.ckcw }}</el-descriptions-item>
                <el-descriptions-item label="入仓日期">{{ data.ssrqid }}</el-descriptions-item>
            </el-descriptions>
            <el-descriptions>
                <el-descriptions-item label="客户条码">{{ data.sptm }}</el-descriptions-item>
                <el-descriptions-item label="仓库条码">{{ data.sptmc }}</el-descriptions-item>
                <el-descriptions-item label="备注">{{ data.spbz || '无' }}</el-descriptions-item>
            </el-descriptions>
            <el-descriptions>
                <el-descriptions-item label="类型">{{ data.spdm }}</el-descriptions-item>
                <el-descriptions-item label="估值单价">{{ data.gjdj }}</el-descriptions-item>
            </el-descriptions>
            </div>
      </el-dialog>
  </template>
  
  <script>
  
  export default {
    name: "CDetail",
    data() {
      return {
        //窗口状态
        openStockDetail:false,
        data:{}
      };
    },
    methods: {  
      /**改变窗口状态 */
      changeStockDetail() {
        this.openStockDetail = !this.openStockDetail;
      },
      /**重置数据 */
      reset(vm) {
        Object.assign(vm.$data, vm.$options.data())
      },
      /**关闭弹窗 */
      beforeClose(done) {
        this.close()
        done()
      },
      /**关闭弹窗 */
      close() {
        this.changeStockDetail()
        this.reset(this)
      },
      /**打开弹窗 */
      open(data) {
        this.changeStockDetail()
        this.data = data
      }
    }
  };
  </script>
  